home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / comm / yep16.zip / YEPU.ZIP / YEPUSTAT.CMD < prev   
OS/2 REXX Batch file  |  1996-02-17  |  2KB  |  68 lines

  1. /* YEPuSTAT - Report number of unique/dupe URLs and info from Yep URL Log
  2.  
  3.  - please edit the line below to reflect the path/filename of your Log,
  4.    or specify filename on command line. I.E. YEPuSTAT url.log
  5.    
  6. */
  7.  
  8. UrlLog = 'c:\osu\yarn\url.log'
  9.  
  10. /* leave these alone */
  11. BetweenRecords = 1;
  12. RecordLines = 0 
  13. UrlNum = 0
  14. URLS. = ''
  15. Records = 0
  16. FirstDate = ''
  17. LastDate = ''
  18.  
  19. Parse arg ln
  20. if (ln \= '') then UrlLog = ln
  21.  
  22. ret = stream(UrlLog,'c','open read')
  23. if ret <> 'READY:' then do
  24.     say 'Can not open URL Log "'UrlLog'" to read.'
  25.     exit
  26. end
  27.     
  28. do while lines(UrlLog)<>0
  29.     ln = linein(UrlLog)
  30.     
  31.     if (ln \= '') & (BetweenRecords = 1) then do
  32.         BetweenRecords = 0;        
  33.         RecordLines = 0
  34.         Duplicate = 0
  35.         Records = Records + 1
  36.     end
  37.     
  38.     if (ln \= '') & (BetweenRecords = 0) & (duplicate = 0) then do
  39.         RecordLines = RecordLines + 1
  40.         Arecord.RecordLines = ln
  41.         if SubStr(ln,1,4) == 'URL:' then do
  42.             do x = 1 to UrlNum 
  43.                 if URLS.x = ln then Duplicate = 1
  44.             end
  45.             if Duplicate = 0 then do
  46.                 UrlNum = UrlNum + 1
  47.                 URLS.UrlNum = ln
  48.             end            
  49.         end
  50.         if SubStr(ln,1,5) = 'Date:' then do
  51.             if UrlNum = 1 then FirstDate = SubStr(ln,7,length(ln)-6)
  52.             LastDate = SubStr(ln,7,length(ln)-6)
  53.         end
  54.     end
  55.  
  56.     if (ln == '') & (BetweenRecords = 0) then do
  57.         betweenRecords = 1;
  58.     end    
  59. end
  60. ret = stream(UrlLog,'c','close')
  61.  
  62. say 'There are 'Records' URLs in "'UrlLog'",'
  63. say 'Of which 'UrlNum' are unique, and 'Records-UrlNum' are duplicates.'
  64. say 'First message date: 'Firstdate
  65. say 'Last message date:  'Lastdate
  66.  
  67.  
  68.